$(document).ready(function() {
	var token = "";
	var loginuuid =$("#loginuuid").val();
	var itv;

	function checkLoginStatus() {
		//调用轮询查询登录状态前先判断当前显示的页面是否为二维码页
		if ($('#qrImageContent').css('display') !== 'none') {
			$.ajax({
				type: 'POST',
				url: "/login/check",
				data: {
					"loginuuid": loginuuid
				},
				success: function(result) {
					if (result) {
						clearInterval(itv);
						console.log(result);
						var auth=result.split("&");
						console.log(auth);
						$("#username").val(auth[0]);
						$("#password").val(auth[1]);
						$("#loginSubmit").click();
						
					}
				}
			});
		}
	}
	itv = setInterval(checkLoginStatus, 1000);
});